package com.rxb.blog.service.impl;

import com.rxb.blog.mapper.DictionaryMapper;
import com.rxb.blog.mapper.FileMapper;
import com.rxb.blog.service.FileService;
import com.rxb.blog.utils.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * Author：rxb
 * Date：2020-02-28 23:22
 * Description：<描述>
 */
@Service
public class FileServiceImpl implements FileService {
    @Autowired
    private FileMapper fileMapper;

    @Autowired
    private DictionaryMapper dictionaryMapper;

    @Override
    public String uploadFile( MultipartFile file) {
        //String article_type_logo_path = dictionaryMapper.getValueByKey("article_type_logo_path");

        String uuid = FileUtil.uploadFile(file, "C:/Users/rxb/Desktop/img");
        return uuid;
    }

    @Override
    public void delete(Integer picture_id) {
        fileMapper.delete(picture_id);
    }

}
